package com.example.administrator.gplineview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ScrollView;

public class PullActivity extends AppCompatActivity {

    private CustomScrollerView customScrollerView;
    private MyScrollView scrollView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pull);
        scrollView = (MyScrollView) findViewById(R.id.scrollview);
        customScrollerView = (CustomScrollerView) findViewById(R.id.activity_pull);
        scrollView.setOnScrollChanged(new MyScrollView.OnScrollChanged() {
            @Override
            public void change(int l, int t, int oldl, int oldt) {
                if(oldt == 0){
                    customScrollerView.setChildScrollerState(true);
                }
                if (t == 0){
                    customScrollerView.setChildScrollerState(false);
                }
            }
        });
    }
}
